package uk.ac.glasgow.demosocs.tests;

import static org.junit.Assert.*;

import java.util.Set;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import uk.ac.glasgow.demosocs.*;
import uk.ac.glasgow.demosocs.impl.*;
import uk.ac.glasgow.demosocs.users.*;
public class AcceptNominationTest{

	VotingSystem vs;
	Election e;
	Candidate c;

	@Before
	public void setUp() throws Exception{
		vs = new VotingSystemImpl();
		vs.setCurrentUser("0901634","changeme");
		vs.createElection("Test", "testType");
		vs.nominateCandidate("0901635");
	}

	@After
	public void tearDown() throws Exception{
		vs = null;
		e = null;
		c = null;
	}

	@Test 
	public void testAcceptNomination(){
		vs.setCurrentUser("0901635", "changeme");
		vs.acceptNomination();
		Set<Candidate> candidates = vs.getCurrentElection().getCandidates();
		assertEquals(True, candidates.contains(new CandidateImpl(vs.getCurrentUserGUID(),vs.getCurrentUser)));
	}
}